Requirements

You need to install the following libraries as described below:

  • astropy

  • pandas and seaborn for the example with a pair plot

  • The SRT single dish tools, of course, with their dependencies.

Install Anaconda then, in a shell:

$ conda create -n py3-clean python=3.6 astropy seaborn numpy scipy matplotlib h5py statsmodels pyyaml numba pandas

$ source activate py3-clean

$ conda install -c astropy pyregion

$ git clone https://github.com/matteobachetti/srt-single-dish-tools

$ cd srt-single-dish-tools

$ pip install .

Using only pip

Open a shell, then

pip install git+https://github.com/matteobachetti/srt-single-dish-tools.git astropy seaborn numpy scipy matplotlib h5py statsmodels pyyaml numba pandas pyregion

And wait some hours for the compilation to complete :)


In [1]:
%load_ext autoreload
%autoreload 2
%matplotlib inline
from __future__ import print_function, division

from astropy.table import Table
import numpy as np
from matplotlib import pyplot as plt

from seaborn import pairplot, lmplot
import warnings
from pandas import read_csv

from astropy.wcs import WCS
from astropy.io import fits
from astropy.utils.data import get_pkg_data_filename
from astropy.visualization import ImageNormalize, LogStretch, MinMaxInterval


warnings.filterwarnings('ignore')

Simulation

We now simulate the observation of a point source and a few calibrator cross scans.


In [2]:
!SDTfake -h


/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/statsmodels/compat/pandas.py:56: FutureWarning: The pandas.core.datetools module is deprecated and will be removed in a future version. Please use the pandas.tseries module instead.
  from pandas.core import datetools
usage: SDTfake [-h] [-s SOURCE_FLUX] [-n NOISE_AMPLITUDE] [-b BASELINE]
               [-g GEOMETRY GEOMETRY GEOMETRY GEOMETRY]
               [--beam-width BEAM_WIDTH] [--spacing SPACING] [-o OUTDIR_ROOT]
               [--scan-speed SCAN_SPEED] [--integration-time INTEGRATION_TIME]
               [--no-cal] [--debug]

Simulate a single scan or a map with a point source.

optional arguments:
  -h, --help            show this help message and exit
  -s SOURCE_FLUX, --source-flux SOURCE_FLUX
                        Source flux in Jy
  -n NOISE_AMPLITUDE, --noise-amplitude NOISE_AMPLITUDE
                        White noise amplitude
  -b BASELINE, --baseline BASELINE
                        Baseline kind: "flat", "slope" (linearly
                        increasing/decreasing), "messy" (random walk) or a
                        number (which gives an amplitude to the random-walk
                        baseline, that would be 20 for "messy")
  -g GEOMETRY GEOMETRY GEOMETRY GEOMETRY, --geometry GEOMETRY GEOMETRY GEOMETRY GEOMETRY
                        Geometry specification: length_ra, length_dec,
                        width_ra, width_dec, in arcmins. A square map of 2
                        degrees would be specified as 120 120 120 120. A
                        cross-like map, 2x2 degrees wide but only along
                        1-degree stripes, is specified as 120 120 60 60
  --beam-width BEAM_WIDTH
                        Gaussian beam width in arcminutes
  --spacing SPACING     Spacing between scans in arcminutes (default 0.5)
  -o OUTDIR_ROOT, --outdir-root OUTDIR_ROOT
                        Output directory root. Here, source and calibrator
                        scans/maps will be saved in outdir/gauss_ra,
                        outdir/gauss_dec, outdir/calibrator1,
                        outdir/calibrator2, where outdir is the outdir root
  --scan-speed SCAN_SPEED
                        Scan speed in arcminutes/second
  --integration-time INTEGRATION_TIME
                        Integration time in seconds
  --no-cal              Don't simulate calibrators
  --debug               Plot stuff and be verbose

In [3]:
!SDTfake -s 20 -b 5 --spacing 0.3 --geometry 60 60 60 60 --beam-width 2.5


/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/statsmodels/compat/pandas.py:56: FutureWarning: The pandas.core.datetools module is deprecated and will be removed in a future version. Please use the pandas.tseries module instead.
  from pandas.core import datetools
100%|█████████████████████████████████████████████| 5/5 [00:02<00:00,  1.92it/s]
100%|█████████████████████████████████████████████| 5/5 [00:01<00:00,  2.75it/s]
Simulating dec scans...
100%|█████████████████████████████████████████| 201/201 [00:27<00:00,  7.36it/s]
Simulating RA scans...
100%|█████████████████████████████████████████| 201/201 [00:26<00:00,  7.64it/s]

Inspect observations

During a night of observations, we will in general observe a number of calibrators and sources, in random order. Our observation will be split into a series of directories:


In [4]:
!ls sim/


calibrator1 calibrator2 gauss_dec   gauss_ra

Some of these observations might have been done in different bands, or using different receivers, and you might have lost the list of observations (or the user was not the observer). The script SDTinspector is there to help, dividing the observations in groups based on observing time, backend, receiver, etc.

Option -d specifies to create configuration files for future analysis, that contain all pointings of a given source with a given configuration and all calibrator observations in the +- 6 hours around the observations.


In [5]:
!SDTinspect sim/*/ -d


/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/statsmodels/compat/pandas.py:56: FutureWarning: The pandas.core.datetools module is deprecated and will be removed in a future version. Please use the pandas.tseries module instead.
  from pandas.core import datetools
Group 0, Backend = TP, Receiver = CCB
---------------
Dummy, observation 1

Source observations:
sim/gauss_dec/
sim/gauss_ra/

Calibrator observations:
sim/calibrator1/
sim/calibrator2/

Skydip observations:

---------------


In [6]:
!cat CCB_TP_Dummy_Obs0.ini


[local]
workdir = .
datadir = .

[analysis]
projection = ARC
interpolation = spline
prefix = test_
list_of_directories = 
	sim/gauss_dec/
	sim/gauss_ra/
calibrator_directories = 
	sim/calibrator1/
	sim/calibrator2/
skydip_directories = 
noise_threshold = 5
pixel_size = 1
goodchans = 
filtering_factor = 0.

We can modify the configuration file, for example changing the pixel size to 1.5, or run SDTinspect with the --options option:


In [9]:
!SDTinspect sim/*/ -d --options '{"pixel_size": 0.7}'


/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/statsmodels/compat/pandas.py:56: FutureWarning: The pandas.core.datetools module is deprecated and will be removed in a future version. Please use the pandas.tseries module instead.
  from pandas.core import datetools
Group 0, Backend = TP, Receiver = CCB
---------------
Dummy, observation 1

Source observations:
sim/gauss_dec/
sim/gauss_ra/

Calibrator observations:
sim/calibrator1/
sim/calibrator2/

Skydip observations:

---------------


In [10]:
!cat CCB_TP_Dummy_Obs0.ini


[local]
workdir = .
datadir = .

[analysis]
projection = ARC
interpolation = spline
prefix = test_
list_of_directories = 
	sim/gauss_dec/
	sim/gauss_ra/
calibrator_directories = 
	sim/calibrator1/
	sim/calibrator2/
skydip_directories = 
noise_threshold = 5
pixel_size = 0.7
goodchans = 
filtering_factor = 0.

Create calibration - plot calibration curves

The configuration file created by SDTinspect can be analyzed by all other scripts. We are now ready to use it to calculate the calibration parameters.

The calibration is calculated by fitting a Gaussian to cross scans over a "calibrator", a source chosen for its high flux stability over time. The fit can be good or bad, so it is always recommended to use the --show and --check options, that plot some diagnostic pictures like that above and save it in the same directory as the calibrator scans, and check that the fluxes of calibrators calculated by using the calibration on their raw data is consistent with the real flux of the calibrators themselves.

The warnings appearing below are mostly innocuous. They are generated by the fact that the main peak is very strong and the gradient in the scan is interpreted as an outlier.


In [12]:
!SDTcal -c CCB_TP_Dummy_Obs0.ini --show --check


/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/statsmodels/compat/pandas.py:56: FutureWarning: The pandas.core.datetools module is deprecated and will be removed in a future version. Please use the pandas.tseries module instead.
  from pandas.core import datetools
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters

Here is an example of a calibrator scan, quite noisy, fit with a Gaussian plus a slopy baseline (File sim/calibrator1/0_Dec_scanfit/Feed0_chan0.png)

After this step, we have a calibration table saved in readable format (.csv) and in binary format (.hdf5). Let's see what the csv table shows us. For example, we can plot the gain curves.


In [13]:
table = read_csv('CCB_TP_Dummy_Obs0_cal.csv')
table['Flux/T'] = table['Flux'] / table['Source_temperature']

In [14]:
plt.figure(figsize=(15, 8))
good = (table['Source'] == 'DummyCal')&(table['Chan'] == 'Feed0_LCP')
plt.scatter(table['Elevation'][good], table['Flux/T'][good],
            label='DummyCal', marker='o')
good = (table['Source'] == 'DummyCal2')&(table['Chan'] == 'Feed0_LCP')
plt.scatter(table['Elevation'][good], table['Flux/T'][good],
            label='DummyCal2', marker='o')

plt.title('Channel: LCP')
plt.xlabel('Elevation')
plt.ylabel('Temperature / Flux Density (K / Jy)')
plt.legend()

plt.figure(figsize=(15, 8))
good = (table['Source'] == 'DummyCal')&(table['Chan'] == 'Feed0_RCP')
plt.scatter(table['Elevation'][good], table['Flux/T'][good],
            label='DummyCal', marker='s')
good = (table['Source'] == 'DummyCal2')&(table['Chan'] == 'Feed0_RCP')
plt.scatter(table['Elevation'][good], table['Flux/T'][good],
            label='DummyCal2', marker='s')

plt.title('Channel: RCP')
plt.xlabel('Elevation')
plt.ylabel('Temperature / Flux Density (K / Jy)')
plt.legend()


Out[14]:
<matplotlib.legend.Legend at 0x1a13e218d0>

In [15]:
fig = plt.figure(figsize=(15., 8))
g = lmplot(x="Elevation", y="Flux/T", row='Source', col='Chan',
           truncate=True, size=5, data=table)


<matplotlib.figure.Figure at 0x1a10a5ca20>

In [16]:
fig = plt.figure(figsize=(15., 8))
g = lmplot(x="Elevation", y="Flux/T",
           truncate=True, data=table)


<matplotlib.figure.Figure at 0x1a14ca1278>

But we can do everything we want with that information... For example a pairplot


In [17]:
pairplot(table, vars=['Elevation', 'Azimuth', 'Flux/Counts', 'Flux/T', 'Flux Integral/Counts', 'Calculated Flux', 'Flux'])


Out[17]:
<seaborn.axisgrid.PairGrid at 0x1a14c4c898>

In [18]:
table


Out[18]:
Dir File Scan Type Source Chan Feed Time Frequency Bandwidth Counts ... Calculated Flux Err RA Dec Fit RA Fit Dec RA err Dec err Skewness Kurtosis Flux/T
0 /Users/meo/devel/spyder_projects/SRT/srt-singl... 0_Dec.fits Dec> DummyCal Feed0_LCP 0 57000.000445 6900.0 680.0 101.698142 ... 0.003919 185.0 75.0 NaN 75.000316 NaN 0.000316 NaN -302.797297 0.327767
1 /Users/meo/devel/spyder_projects/SRT/srt-singl... 0_Dec.fits Dec> DummyCal Feed0_RCP 0 57000.000445 6900.0 680.0 90.562382 ... 0.003080 185.0 75.0 NaN 75.000315 NaN 0.000315 -1.515503 18.060835 0.331263
2 /Users/meo/devel/spyder_projects/SRT/srt-singl... 0_Ra.fits RA> DummyCal Feed0_LCP 0 57000.000144 6900.0 680.0 100.740628 ... 0.002861 185.0 75.0 185.000245 NaN 0.000245 NaN -1.039798 -11.406534 0.330882
3 /Users/meo/devel/spyder_projects/SRT/srt-singl... 0_Ra.fits RA> DummyCal Feed0_RCP 0 57000.000144 6900.0 680.0 88.540888 ... 0.003382 185.0 75.0 185.003771 NaN 0.003771 NaN -1.765636 24.154794 0.338826
4 /Users/meo/devel/spyder_projects/SRT/srt-singl... 1_Dec.fits Dec< DummyCal Feed0_LCP 0 57000.001046 6900.0 680.0 99.578511 ... 0.003653 185.0 75.0 NaN 74.998397 NaN -0.001603 NaN -656.371494 0.334744
5 /Users/meo/devel/spyder_projects/SRT/srt-singl... 1_Dec.fits Dec< DummyCal Feed0_RCP 0 57000.001046 6900.0 680.0 90.240851 ... 0.004058 185.0 75.0 NaN 74.998985 NaN -0.001015 41.064269 -358.736662 0.332443
6 /Users/meo/devel/spyder_projects/SRT/srt-singl... 1_Ra.fits RA< DummyCal Feed0_LCP 0 57000.000745 6900.0 680.0 100.996299 ... 0.003963 185.0 75.0 184.996211 NaN -0.003789 NaN NaN -346.635364 0.330047
7 /Users/meo/devel/spyder_projects/SRT/srt-singl... 1_Ra.fits RA< DummyCal Feed0_RCP 0 57000.000745 6900.0 680.0 90.955710 ... 0.003273 185.0 75.0 184.994480 NaN -0.005520 NaN 16.071160 -121.337685 0.329831
8 /Users/meo/devel/spyder_projects/SRT/srt-singl... 2_Dec.fits Dec> DummyCal Feed0_LCP 0 57000.001647 6900.0 680.0 99.378056 ... 0.003321 185.0 75.0 NaN 75.000312 NaN 0.000312 -1.225996 20.031737 0.335404
9 /Users/meo/devel/spyder_projects/SRT/srt-singl... 2_Dec.fits Dec> DummyCal Feed0_RCP 0 57000.001647 6900.0 680.0 88.377983 ... 0.002871 185.0 75.0 NaN 74.999866 NaN -0.000134 -3.071445 -7.038698 0.339451
10 /Users/meo/devel/spyder_projects/SRT/srt-singl... 2_Ra.fits RA> DummyCal Feed0_LCP 0 57000.001346 6900.0 680.0 97.354235 ... 0.003781 185.0 75.0 184.998448 NaN -0.001552 NaN 7.013369 17.131117 0.342388
11 /Users/meo/devel/spyder_projects/SRT/srt-singl... 2_Ra.fits RA> DummyCal Feed0_RCP 0 57000.001346 6900.0 680.0 90.506601 ... 0.002675 185.0 75.0 185.000151 NaN 0.000151 NaN 0.559799 1.388792 0.331467
12 /Users/meo/devel/spyder_projects/SRT/srt-singl... 3_Dec.fits Dec< DummyCal Feed0_LCP 0 57000.002248 6900.0 680.0 98.400931 ... 0.003682 185.0 75.0 NaN 74.999597 NaN -0.000403 0.686901 19.872509 0.338770
13 /Users/meo/devel/spyder_projects/SRT/srt-singl... 3_Dec.fits Dec< DummyCal Feed0_RCP 0 57000.002248 6900.0 680.0 87.568573 ... 0.003385 185.0 75.0 NaN 74.998657 NaN -0.001343 -2.857871 24.758359 0.342588
14 /Users/meo/devel/spyder_projects/SRT/srt-singl... 3_Ra.fits RA< DummyCal Feed0_LCP 0 57000.001947 6900.0 680.0 98.285734 ... 0.002977 185.0 75.0 184.996416 NaN -0.003584 NaN 5.032425 -0.759008 0.339147
15 /Users/meo/devel/spyder_projects/SRT/srt-singl... 3_Ra.fits RA< DummyCal Feed0_RCP 0 57000.001947 6900.0 680.0 88.279675 ... 0.003001 185.0 75.0 184.992748 NaN -0.007252 NaN 2.505980 14.447963 0.339829
16 /Users/meo/devel/spyder_projects/SRT/srt-singl... 4_Dec.fits Dec> DummyCal Feed0_LCP 0 57000.002849 6900.0 680.0 98.299374 ... 0.003022 185.0 75.0 NaN 74.999211 NaN -0.000789 -0.209759 20.063538 0.339100
17 /Users/meo/devel/spyder_projects/SRT/srt-singl... 4_Dec.fits Dec> DummyCal Feed0_RCP 0 57000.002849 6900.0 680.0 89.768730 ... 0.004334 185.0 75.0 NaN 74.999633 NaN -0.000367 -19.869247 -27.165491 0.334192
18 /Users/meo/devel/spyder_projects/SRT/srt-singl... 4_Ra.fits RA> DummyCal Feed0_LCP 0 57000.002548 6900.0 680.0 97.536311 ... 0.004974 185.0 75.0 185.003076 NaN 0.003076 NaN -0.096695 14.811600 0.341753
19 /Users/meo/devel/spyder_projects/SRT/srt-singl... 4_Ra.fits RA> DummyCal Feed0_RCP 0 57000.002548 6900.0 680.0 88.360153 ... 0.003255 185.0 75.0 184.998127 NaN -0.001873 NaN -5.801998 -9.322311 0.339519
20 /Users/meo/devel/spyder_projects/SRT/srt-singl... 0_Dec.fits Dec> DummyCal2 Feed0_LCP 0 57000.000445 6900.0 680.0 100.462686 ... 0.004202 185.0 75.0 NaN 74.998482 NaN -0.001518 -33.387254 -272.278283 0.331798
21 /Users/meo/devel/spyder_projects/SRT/srt-singl... 0_Dec.fits Dec> DummyCal2 Feed0_RCP 0 57000.000445 6900.0 680.0 89.827621 ... 0.003921 185.0 75.0 NaN 74.999937 NaN -0.000063 5.051650 22.790368 0.333973
22 /Users/meo/devel/spyder_projects/SRT/srt-singl... 0_Ra.fits RA> DummyCal2 Feed0_LCP 0 57000.000144 6900.0 680.0 99.960493 ... 0.003706 185.0 75.0 185.002944 NaN 0.002944 NaN 3.842087 24.460521 0.333454
23 /Users/meo/devel/spyder_projects/SRT/srt-singl... 0_Ra.fits RA> DummyCal2 Feed0_RCP 0 57000.000144 6900.0 680.0 93.733358 ... 0.003292 185.0 75.0 184.997396 NaN -0.002604 NaN 155.599619 -38596.921356 0.320055
24 /Users/meo/devel/spyder_projects/SRT/srt-singl... 1_Dec.fits Dec< DummyCal2 Feed0_LCP 0 57000.001046 6900.0 680.0 100.366984 ... 0.003151 185.0 75.0 NaN 74.998564 NaN -0.001436 0.754847 -76.008729 0.332114
25 /Users/meo/devel/spyder_projects/SRT/srt-singl... 1_Dec.fits Dec< DummyCal2 Feed0_RCP 0 57000.001046 6900.0 680.0 89.854534 ... 0.003542 185.0 75.0 NaN 74.998212 NaN -0.001788 -10.794167 -29.732142 0.333872
26 /Users/meo/devel/spyder_projects/SRT/srt-singl... 1_Ra.fits RA< DummyCal2 Feed0_LCP 0 57000.000745 6900.0 680.0 100.713616 ... 0.003313 185.0 75.0 184.994078 NaN -0.005922 NaN -14.926049 -191.590108 0.330971
27 /Users/meo/devel/spyder_projects/SRT/srt-singl... 1_Ra.fits RA< DummyCal2 Feed0_RCP 0 57000.000745 6900.0 680.0 93.590864 ... 0.003971 185.0 75.0 184.993453 NaN -0.006547 NaN NaN -434.034742 0.320544
28 /Users/meo/devel/spyder_projects/SRT/srt-singl... 2_Dec.fits Dec> DummyCal2 Feed0_LCP 0 57000.001647 6900.0 680.0 99.555544 ... 0.003276 185.0 75.0 NaN 75.000404 NaN 0.000404 2.168013 -131.844254 0.334829
29 /Users/meo/devel/spyder_projects/SRT/srt-singl... 2_Dec.fits Dec> DummyCal2 Feed0_RCP 0 57000.001647 6900.0 680.0 91.493055 ... 0.003093 185.0 75.0 NaN 75.000076 NaN 0.000076 2.303544 0.382212 0.327894
30 /Users/meo/devel/spyder_projects/SRT/srt-singl... 2_Ra.fits RA> DummyCal2 Feed0_LCP 0 57000.001346 6900.0 680.0 99.413113 ... 0.004033 185.0 75.0 185.001538 NaN 0.001538 NaN -24.189517 -90.054067 0.335301
31 /Users/meo/devel/spyder_projects/SRT/srt-singl... 2_Ra.fits RA> DummyCal2 Feed0_RCP 0 57000.001346 6900.0 680.0 90.350531 ... 0.003594 185.0 75.0 184.998744 NaN -0.001256 NaN -4.631511 19.535676 0.332046
32 /Users/meo/devel/spyder_projects/SRT/srt-singl... 3_Dec.fits Dec< DummyCal2 Feed0_LCP 0 57000.002248 6900.0 680.0 99.694710 ... 0.003302 185.0 75.0 NaN 74.997773 NaN -0.002227 -15.585320 -289.719210 0.334354
33 /Users/meo/devel/spyder_projects/SRT/srt-singl... 3_Dec.fits Dec< DummyCal2 Feed0_RCP 0 57000.002248 6900.0 680.0 89.633836 ... 0.003026 185.0 75.0 NaN 74.998507 NaN -0.001493 0.931807 19.094197 0.334694
34 /Users/meo/devel/spyder_projects/SRT/srt-singl... 3_Ra.fits RA< DummyCal2 Feed0_LCP 0 57000.001947 6900.0 680.0 100.892376 ... 0.004781 185.0 75.0 184.992274 NaN -0.007726 NaN 85.524125 -514.165581 0.330385
35 /Users/meo/devel/spyder_projects/SRT/srt-singl... 3_Ra.fits RA< DummyCal2 Feed0_RCP 0 57000.001947 6900.0 680.0 90.418649 ... 0.003262 185.0 75.0 184.997045 NaN -0.002955 NaN -0.832421 19.701083 0.331790
36 /Users/meo/devel/spyder_projects/SRT/srt-singl... 4_Dec.fits Dec> DummyCal2 Feed0_LCP 0 57000.002849 6900.0 680.0 99.256590 ... 0.003717 185.0 75.0 NaN 74.998955 NaN -0.001045 -1.186030 8.229052 0.335830
37 /Users/meo/devel/spyder_projects/SRT/srt-singl... 4_Dec.fits Dec> DummyCal2 Feed0_RCP 0 57000.002849 6900.0 680.0 89.103779 ... 0.003760 185.0 75.0 NaN 75.000014 NaN 0.000014 0.474984 19.586641 0.336676
38 /Users/meo/devel/spyder_projects/SRT/srt-singl... 4_Ra.fits RA> DummyCal2 Feed0_LCP 0 57000.002548 6900.0 680.0 101.312099 ... 0.003599 185.0 75.0 184.998896 NaN -0.001104 NaN 0.772077 -4.955285 0.329022
39 /Users/meo/devel/spyder_projects/SRT/srt-singl... 4_Ra.fits RA> DummyCal2 Feed0_RCP 0 57000.002548 6900.0 680.0 92.841965 ... 0.003069 185.0 75.0 185.001524 NaN 0.001524 NaN 0.139528 -41.957823 0.323129

40 rows × 33 columns

Create map

This is done with SDTimage. WCS coordinates are automatically calculated and results are written into a ds9- and casaviewer-compatible FITS file.

To visualize, I'm using the astropy library here.

The -e <regionfile> tells the baseline subtraction algorithm to ignore a given part of the map where strong sources are present. This region file has to be in DS9 format and contain coordinates in the fk5 reference frame. E.g.


In [19]:
!cat center.reg


# Region file format: DS9 version 4.1
global color=green dashlist=8 3 width=1 font="helvetica 10 normal roman" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
fk5
circle(12:00:00.000,+70:00:00.00,600")

As usual, please ignore below the warnings about outliers. This meanse that the baseline subtraction algorithm is ignoring some points from the fit.


In [20]:
!SDTimage -c CCB_TP_Dummy_Obs0.ini --sub --refilt -e center.reg


/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/statsmodels/compat/pandas.py:56: FutureWarning: The pandas.core.datetools module is deprecated and will be removed in a future version. Please use the pandas.tseries module instead.
  from pandas.core import datetools
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 1 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1067-py3.6.egg/srttools/fit.py:304: UserWarning: Found 2 outliers
  UserWarning)

In [21]:
def plot_image(file, ext, logstretch=False):
    hdu = fits.open(file)[ext]
    wcs = WCS(hdu.header)

    plt.figure(figsize=(10, 10))
    ax = plt.subplot(projection=wcs)
    img = hdu.data
    if logstretch:
        # Create an ImageNormalize object
        norm = ImageNormalize(img, interval=MinMaxInterval(),
                              stretch=LogStretch())
        im = ax.imshow(img, origin='lower', cmap='viridis', norm=norm)
    else:
        im = ax.imshow(img, origin='lower', cmap='viridis')
        
    print("Image max is", np.max(img))
    print("Image sum is", np.sum(img))
    print("Image median is", np.median(img))

    ax.coords.grid(True, color='white', ls='solid')
    ax.coords[0].set_axislabel('Right Ascension (J2000)')
    ax.coords[1].set_axislabel('Declination (J2000)')

    overlay = ax.get_coords_overlay('galactic')
    overlay.grid(color='white', ls='dotted')
    overlay[0].set_axislabel('Galactic Longitude')
    overlay[1].set_axislabel('Galactic Latitude')
    plt.colorbar(im)

plot_image('CCB_TP_Dummy_Obs0.fits', 1)


Image max is 1982.078958262568
Image sum is 159945.89269356267
Image median is 0.028074927707476653

In [22]:
plot_image('CCB_TP_Dummy_Obs0.fits', 1, logstretch=True)


Image max is 1982.078958262568
Image sum is 159945.89269356267
Image median is 0.028074927707476653

The log-stretched image shows that the noisy scans can create stripes in the map. There are a couple of different ways to deal with this in SDT. One is interactive and the other is automatic. Let us now use the...

Interactive filtering

We can cleanup the scans interactively. A window opens and we can point and click to select all scans passing through a pixel, and flag bad scans, zap intervals, redo baseline fitting, etc.

Please follow the instructions that appear in the shell. For example, to select all scans passing through a given pixel and +- 1 pixel around, point the pixel with the mouse and press "a". A new window will open showing all the scans. Click on a scan (it becomes green), and filter out intervals in the scan, fit a new baseline, flag scans, etc. by following the instructions appearing in the shell.


In [19]:
!SDTimage -c CCB_TP_Dummy_Obs0.ini --interactive


/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/statsmodels/compat/pandas.py:56: FutureWarning: The pandas.core.datetools module is deprecated and will be removed in a future version. Please use the pandas.tseries module instead.
  from pandas.core import datetools
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
402/402
        -------------------------------------------------------------

        Imageactive display.

        You see here two images. The left one gives, for each bin, a number
        measuring the probability of outliers (based on the median absolute
        deviation if there are >10 scans per bin, and on the standard deviation
        otherwise), The right one is the output image of the processing.
        The right image is normalized with a ds9-like log scale.

        -------------------------------------------------------------

        Point the mouse on a pixel in the Outlier image and press a key:

        a    open a window to filter all scans passing through this pixel
        h    print help
        q    quit

        -------------------------------------------------------------
        
(23.041935483870972, 22.255, 'q')
(None, None, 'q')

Calibrate the image

Now we can calibrate the image, using the calibration calculated above, using the option --calibrate <CALFILE>.hdf5 and specifying the unit (Jy/beam, Jy/pixel, or Jy/sterad) with -u <UNIT>

Note: instead of the calibration file, we can give the HDF5 file dumped by SDTimage in the previous processing. Instead of SDTimage -c CCB_TP_Dummy_Obs0.ini, we could use SDTimage CCB_TP_Dummy_Obs0_dump.hdf5


In [23]:
!SDTimage -c CCB_TP_Dummy_Obs0.ini -u 'Jy/pixel' --calibrate CCB_TP_Dummy_Obs0_cal.hdf5


/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/statsmodels/compat/pandas.py:56: FutureWarning: The pandas.core.datetools module is deprecated and will be removed in a future version. Please use the pandas.tseries module instead.
  from pandas.core import datetools
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
402/402

In [24]:
plot_image('CCB_TP_Dummy_Obs0_cal.fits', 1, logstretch=True)


Image max is 0.2247480332018821
Image sum is 18.12869310148658
Image median is 3.202302772118162e-06

Destriping

After the most problematic scans have been eliminated, we can use a new algorithm to "destripe" the image. This algorithm is known as "basket weaving", because it's a little bit like making coincide stripes orthogonal to each other. To use this algorithm, we use the option --destripe


In [36]:
!SDTimage CCB_TP_Dummy_Obs0_dump.hdf5 -u 'Jy/beam' --calibrate CCB_TP_Dummy_Obs0_cal.hdf5 --destripe


/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/statsmodels/compat/pandas.py:56: FutureWarning: The pandas.core.datetools module is deprecated and will be removed in a future version. Please use the pandas.tseries module instead.
  from pandas.core import datetools
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
/Users/meo/anaconda/envs/py3/lib/python3.6/site-packages/srttools-0.5.dev1069-py3.6.egg/srttools/destripe.py:159: RuntimeWarning: invalid value encountered in true_divide
  (image_hor*expo_hor + image_ver*expo_ver) / (expo_hor + expo_ver)
WARNING: path= was not specified but multiple tables are present, reading in first available table (path=table) [astropy.io.misc.hdf5]

In [37]:
plot_image('CCB_TP_Dummy_Obs0_cal_destripe.fits', 1, logstretch=True)


Image max is 19.266596090571003
Image sum is 1554.8390897968554
Image median is 0.00017813541981552756

In [ ]: